#! /bin/sh

export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:
runlevel=S
prevlevel=N
umask 022
export PATH runlevel prevlevel

#
#	Trap CTRL-C &c only in this shell so we can interrupt subprocesses.
#
trap ":" INT QUIT TSTP
/bin/hostname zlb2440

/bin/mount -n -t proc none /proc
/bin/mount -n -t sysfs none /sys
/bin/mount -n -t usbfs none /proc/bus/usb
/bin/mount -n -t ramfs none /dev

echo /sbin/mdev > /proc/sys/kernel/hotplug
/sbin/mdev -s
#/bin/hotplug
# mounting file system specified in /etc/fstab
mkdir -p /dev/pts
mkdir -p /dev/shm
/bin/mount -n -t devpts none /dev/pts -o mode=0622
/bin/mount -n -t tmpfs tmpfs /dev/shm
/bin/mount -n -t ramfs none /tmp
/bin/mount -n -t ramfs none /var
#/bin/mount -t jffs2 /dev/mtdblock5 /data
#/usr/sbin/ubiattach /dev/ubi_ctrl -m 3
#/bin/mount -t ubifs ubi0:rootfs /data
#/bin/mount -a
# mount fs
#/bin/mount -o remount,rw / 

mkdir -p /var/empty
mkdir -p /var/log
mkdir -p /var/lock
mkdir -p /var/run
mkdir -p /var/tmp

/sbin/hwclock -s

syslogd
#/etc/rc.d/init.d/netd start
echo "                        " > /dev/tty1
echo "Starting networking..." > /dev/tty1
sleep 1
#/etc/rc.d/init.d/httpd start
echo "                        " > /dev/tty1
echo "Starting web server..." > /dev/tty1
sleep 1
#/etc/rc.d/init.d/leds start
echo "                        " > /dev/tty1
echo "Starting leds service..." > /dev/tty1
echo "                        "
sleep 1

/sbin/ifconfig lo 127.0.0.1
#/etc/init.d/ifconfig-eth0
/sbin/ifconfig eth0 192.168.1.6 netmask 255.255.255.0
/sbin/ifconfig eth0 hw ether 00:60:08:ad:c1:61

/sbin/route add default gw 192.168.1.1

echo "Done"
echo "Done" > /dev/ttySAC0
/usr/sbin/dropbear &

if [ -x /app/appinit.sh ] ; then
       /app/appinit.sh
fi

#   /bin/qtopia &
#   echo "                                  " > /dev/tty1
#   echo "Starting Qtopia, please waiting..." > /dev/tty1
#
